package com.zwxbc.funplay.service.impl;

import com.zwxbc.funplay.dao.GameCateGoryDao;
import com.zwxbc.funplay.dao.impl.GameCategoryDaoImpl;
import com.zwxbc.funplay.entity.GameCategory;
import com.zwxbc.funplay.service.GameCategoryService;

import java.util.List;

/**
 * @author Liubuzhu
 */
public class GameCategoryServiceImpl implements GameCategoryService {
	GameCateGoryDao gameCateGoryDao = new GameCategoryDaoImpl();
	@Override
	public List<GameCategory> getGameCategoryList() {
		return gameCateGoryDao.getAllGameCategories();
	}

	@Override
	public boolean deleteGameCategory(Long GameCategoryId) {
		int result = gameCateGoryDao.deleteGameCategory(GameCategoryId);
		return result > 0;
	}

	@Override
	public boolean updateGameCategory(GameCategory GameCategory) {
		int result = gameCateGoryDao.updateGameCategory(GameCategory);
		return result > 0;
	}

	@Override
	public boolean addGameCategory(GameCategory GameCategory) {
		int result = gameCateGoryDao.addGameCategory(GameCategory);
		return result > 0;
	}

	@Override
	public GameCategory getGameCategoryById(Long GameCategoryId) {
		return gameCateGoryDao.getGameCategoryById(GameCategoryId);
	}
}
